package com.xm.conf;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectAckRabbitConfig {
    @Bean
    public Queue directQueueAck(){
        return new Queue("directQueueAck");
    }
    @Bean
    public Queue directEmailQueueAck(){
        return new Queue("directEmailQueueAck");
    }
    @Bean
    public Queue directQueueAck11(){
        return new Queue("directQueueAck11");
    }
    @Bean
    public Queue directQueueAckNew(){
        return new Queue("directQueueAckNew");
    }

    @Bean
    DirectExchange directExchangeAck(){
        return new DirectExchange("directExchangeAck", true, false);
    }
    @Bean
    DirectExchange directEmailExchangeAck(){
        return new DirectExchange("directEmailExchangeAck", true, false);
    }
    @Bean
    DirectExchange directExchangeAckNew(){
        return new DirectExchange("directExchangeAckNew", true, false);
    }
    @Bean
    DirectExchange directExchangeAck11(){
        return new DirectExchange("directExchangeAck11", true, false);
    }

    @Bean
    Binding bindingAck(){
        return BindingBuilder.bind(directQueueAck()).to(directExchangeAck()).with("directRoutingKeyAck");
    }
    @Bean
    Binding bindingEmailAck(){
        return BindingBuilder.bind(directEmailQueueAck()).to(directEmailExchangeAck()).with("directEmailRoutingKeyAck");
    }
    @Bean
    Binding bindingAck11(){
        return BindingBuilder.bind(directQueueAck11()).to(directExchangeAck11()).with("directRoutingKeyAck11");
    }
    @Bean
    Binding bindingAckNew(){
        return BindingBuilder.bind(directQueueAckNew()).to(directExchangeAckNew()).with("directRoutingKeyAckNew");
    }

}
